
import Axios from 'axios';

export const getDetails=(data)=>{
    return {
        type:'GETDETAILS',
        payload:data
    }
}
export const getProduct=(id)=>{
    return dispatch=>{
        Axios({
            url:`http://localhost:3000/product/${id}`,
            method:'get'
        }).then(res=>{
            console.log(res.data)
            dispatch(getDetails(res.data))
        })
    }
}